#-----"-g": generate debug info for gdb, etc.
#----"-O2": optimize the produced code to level 2.
#-----"-I": the path of depended header files.
MySQLincludePath=/usr/include/mysql
MySQLPPIncludePath=/usr/local/include/mysql++/

.PHONY: all clean

all: queryUpdate 

queryUpdate: printdata.o queryUpdate.o
	g++ -o queryUpdate  printdata.o queryUpdate.o -L/usr/lib/mysql/ -L/usr/local/lib   -lmysqlclient   -lmysqlpp 
	
printdata.o: printdata.cpp
	g++ -c -o printdata.o   -I$(MySQLPPIncludePath)      -I$(MySQLincludePath) -g -O2 ./printdata.cpp
queryUpdate.o: queryUpdate.cpp
	g++ -c -o queryUpdate.o     -I$(MySQLPPIncludePath)      -I$(MySQLincludePath) -g -O2 ./queryUpdate.cpp

clean:
	rm -f *.o queryUpdate 

run:
	./queryUpdate
